home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 4
/
The Arsenal Files 4 (Arsenal Computer).ISO
/
casm
/
au116-as.exe
/
UTIL
/
CLEANPTH.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-06
|
937b
|
48 lines
#include "..\au.hpp"
/**************************************************************************/
int clean_paths(AU *au, LISTPTR *paths_list)
{
int largest;
int len;
LIST *save;
LIST *el;
/* kill all the files and directories behind */
for (el = paths_list->head; el != NULL; el = el->next)
{
cd(au, el->data);
system("echo Y | del *.* >NUL");
/* Null out destination directory */
if (el->next == NULL)
el->data[0] = '\0';
}
cd(au, au->source_directory);
/* Remove the directories, largest first */
for(EVER)
{
save = NULL;
largest = 0;
for (el = paths_list->head; el != NULL; el = el->next)
{
if (el->data[0] != '\0')
{
len = strlen(el->data);
if (len > largest)
{
largest = len;
save = el;
}
}
}
if (save == NULL)
break;
rmdir(save->data);
save->data[0] = '\0';
}
paths_list->destroy();
return 0;
}